<template>
  <div
    class="_wrapper _radius-15p _p10 _box-scroll _p-b-20 _rel"
    style="background-color: black"
  >
    <el-button class="_abs-btn-rb" @click="list = []">清理</el-button>
    <div v-for="(item, _index) in list" :key="_index">{{ item }}</div>
  </div>
</template>
<script>
import { initDefault } from "@/tool/tool-mqtt";

export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    let mqttApi = initDefault();
    mqttApi.subscribe("/com-server/212/msg/" + this.comCode, (msg) => {
      this.list.push(msg);
    });
    mqttApi.subscribe("/com-server/cmd-exe/" + this.comCode, (msg) => {
      this.list.push(msg);
    });
    console.log(this.comCode);
  },
};
</script>
<style lang=""></style>
